/**      
* Test1.java Create on 2012-11-7     
*      
* Copyright (c) 2012 by GreenShore Network
* Company: 上海绿岸网络科技有限公司(Shanghai GreenShore Network Technology Co.,Ltd.)
*
*/ 

package banfangtang.applet;

import java.util.Iterator;
import java.util.Random;

/** 
 * @ClassName: Test1 
 * @Description: TODO(...) 
 * @author caisheng
 * @date 2012-11-7 上午9:36:30 
 * @Version 1.0
 * 
 */
public class Test1 {

	private static Random r = new Random();
	
	private static final String[] str_cha = new String[]{
		"0","1","2","3","4","5","6","7","8","9",
		"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z",
		"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"};
	
	public static String buildRandomStringEN(int length){
		if(length <= 0 ){return "";
		}
		int newLength = length > 2048 ? 2048 : length;
		StringBuilder sb = new StringBuilder();
		
		for (int i = 0; i < newLength; i++) {
			sb.append(str_cha[r.nextInt(62)]);
		}
		return sb.toString();
	}
	
	public static void main(String[] args) {
		for (int i = 0; i < 1; i++) {
			System.out.println(buildRandomStringEN(3000));
		}
	}

}
